docs: fix system prompt contradictions and suppress deepagents memory middleware - #721
Merged
Conversation
… middleware - Merge verbosity cap and Different Factor into single conditional rule - Remove hardcoded subagent tool lists (drift-prone, schemas are source of truth) - Drop tool schema validation section (infrastructure noise) - Load AGENTS.md directly into system prompt instead of via memory: param to prevent deepagents MemoryMiddleware from injecting its own guidelines
avoidwork
force-pushed
the
docs/system-prompt-audit-fixes
branch
from
August 9, 2026 16:44
28a0ef0 to
67a1d26
Compare
The manual string slicing in #relativePath() was mangling paths when config.cwd was empty (defaulting to "" in config.yaml). This caused deepAgents to receive invalid relative paths like 'home/...' instead of 'skills/...', leading to 'skill not found in registry' errors. Replaced with path.relative() which correctly handles the conversion, and added process.cwd() fallback when config.cwd is empty.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
System prompt audit against deepagents source revealed contradictions and redundant sections. This PR resolves all findings.
Type of Change
Testing
npm run test)readFileSyncload in deepAgents.jsCoverage
Checklist
npm run lintpassesChanges
prompts/SYSTEM_PROMPT.mdsrc/agent/deepAgents.jsmemory: [agentsPath]fromcreateDeepAgent()and load AGENTS.md directly into the system prompt viareadFileSync. This preventsMemoryMiddlewarefrom wrapping memory content in deepagents hardcodedMEMORY_SYSTEM_PROMPTwith conflicting guidelines.Memory data (profile, clarifications, reflection, ephemeral) still flows through
loadSystemPrompt()→loadContext()→ appended to the system prompt. Your MEMORY section now has sole authority over how memory is used.